package unit11.extractSuperclass;

import java.util.ArrayList;
import java.util.List;

/**
 * @author v_irlwang
 * @date 2021/5/24
 */
public class Department extends Party {

    private List<Employee> staff = new ArrayList<>();

    public Department(String name) {
        super(name);
    }

    public int getHeadCount() {
        return staff.size();
    }

    public int getAnnualCost() {
        int result = 0;
        for (Employee employee : staff) {
            result += employee.getAnnualCost();
        }
        return result;
    }


}
